package de.haw.adt.implementation;

import de.haw.adt.interfaces.IAcc;
import de.haw.adt.interfaces.IArea;
import de.haw.adt.interfaces.IForce;
import de.haw.adt.interfaces.ILength;
import de.haw.adt.interfaces.IMass;
import de.haw.adt.interfaces.IPower;
import de.haw.adt.interfaces.ISpeed;
import de.haw.adt.interfaces.ITimeDiff;
import de.haw.adt.interfaces.IWork;

public final class Values { // nonsubclassable
	private Values() {
	} // noninstantiable
	// PUBLIC LENGTH CONSTANTS

	public static final int ZERO = 0;
	public static final ILength ZERO_LENGTH = lengthInM(0.0);
	// PRIVATE LENGTH CONSTANTS
	public static final double FEET_IN_METERS = 0.3048;
	public static final double METER_IN_NANOMETER = 1000000000;
	public static final double KILO = 1000;
	public static final double KMH_IN_MS = 3.6;
	public static final double SEC_IN_H = 3600;

	public static ITimeDiff TimeDiffInS(double seconds){
		return TimeDiff.valueOf(seconds);
	}
	
	public static ILength lengthInM(double meters) {
		return Length.valueOf(meters);
	}

	public static ILength lengthInFt(double feet) {
		return Length.valueOf(feet * FEET_IN_METERS);
	}
	
	public static IArea areaInSqM(double area) {
		return Area.valueOf(area);
	}
	
	public static IMass massInKg(double kilogramms) {
		return Mass.valueOf(kilogramms);
	}
	
	public static ISpeed speedInMs(double speed) {
		return Speed.valueOf(speed);
	}
	
	public static IAcc accInMSs(double acc) {
		return Acc.valueOf(acc);
	}
	
	public static IForce forceInN(double force) {
		return Force.valueOf(force);
	}
	
	public static IWork workInJ(double work) {
		return Work.valueOf(work);
	}
	
	public static IPower powerInW(double power) {
		return Power.valueOf(power);
	}
}

